load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test_suite")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/crypto/iccsa",
    "//rs/crypto/internal/crypto_lib/basic_sig/cose",
    "//rs/crypto/internal/crypto_lib/basic_sig/der_utils",
    "//rs/crypto/internal/crypto_lib/basic_sig/ecdsa_secp256k1",
    "//rs/crypto/internal/crypto_lib/basic_sig/ecdsa_secp256r1",
    "//rs/crypto/internal/crypto_lib/basic_sig/ed25519",
    "//rs/crypto/internal/crypto_lib/basic_sig/iccsa",
    "//rs/crypto/internal/crypto_lib/basic_sig/rsa_pkcs1",
    "//rs/crypto/sha2",
    "//rs/types/types",
]

DEV_DEPENDENCIES = [
    # Keep sorted.
    "//packages/ic-secp256r1",
    "//rs/crypto/internal/test_vectors",
    "//rs/crypto/test_utils/canister_sigs",
    "//rs/crypto/test_utils/reproducible_rng",
    "@crate_index//:assert_matches",
    "@crate_index//:hex",
    "@crate_index//:p256",
    "@crate_index//:rand",
    "@crate_index//:simple_asn1",
    "@crate_index//:strum",
]

MACRO_DEPENDENCIES = []

MACRO_DEV_DEPENDENCIES = []

ALIASES = {}

rust_library(
    name = "standalone-sig-verifier",
    srcs = glob(["src/**/*.rs"]),
    aliases = ALIASES,
    crate_name = "ic_crypto_standalone_sig_verifier",
    proc_macro_deps = MACRO_DEPENDENCIES,
    deps = DEPENDENCIES,
)

rust_test_suite(
    name = "standalone_sig_verifier_integration",
    srcs = glob(["tests/**/*.rs"]),
    aliases = ALIASES,
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = [":standalone-sig-verifier"] + DEPENDENCIES + DEV_DEPENDENCIES,
)
